using UnityEngine;
using Utils.Extends;

namespace Modules.Animation
{
    public class HumanAnimatorProxy : AnimatorProxy
    {
        [SerializeField] private Transform mouth;

        private Transform _mouth;

        public Transform Mouth
        {
            get
            {
                if (_mouth == null)
                {
                    _mouth = transform.QueryComponent<Transform>("Face_M");
                }

                return _mouth;
            }
        }

        public void BeginTalk()
        {
            Anim.speed = 1;
            Anim.SetLayerWeight(1, 1);
        }

        public void StopTalk()
        {
            Anim.SetLayerWeight(1, 0);
        }
    }
}